#include "EpilIndexExpressionCode.h"
#include "EpilOutputHelper.h"
#include "TCharSupport.h"
#include "EpilPointerHelper.h"


EpilIndexExpressionCode::EpilIndexExpressionCode( const EpilLexLocation & location )
: EpilExpressionCodeBase( location )
, m_indexExpression( NULL )
, m_tableExpression( NULL )
{
}


EpilIndexExpressionCode::~EpilIndexExpressionCode()
{
	EpilPointerHelper::SafeDelete( m_tableExpression );
	EpilPointerHelper::SafeDelete( m_indexExpression );
}


tstring EpilIndexExpressionCode::ToEpilCode( int indent ) const
{
	tstringstream ret;
	ret << m_tableExpression->ToEpilCode();
	ret << t("[");
	ret << m_indexExpression->ToEpilCode();
	ret << t("]");
	return ret.str();
}